<script setup>
import FirstTitle from "@comp/FirstTitle";
import { onMounted } from "vue";
import PsbzTable from "@comp/llyy/PsbzTable";
import { postTableData } from "@/api/table";

const city = window.globalObj.name;

const kqzyHeaders = [
  {
    label: "时间",
    prop: "stage_name",
    minWidth: "90",
  },
  {
    label: "内容",
    prop: "xt_content",
    minWidth: "150",
  },
  {
    label: "方法",
    prop: "xt_method",
    minWidth: "300",
  },
  {
    label: "注意事项",
    prop: "matters",
    minWidth: "150",
  },
];

const kqzyList = ref([]);

const llbcHeaders = [
  {
    label: "序号",
    prop: "rowNum",
    minWidth: "90",
  },
  {
    label: "单位",
    prop: "area_name",
    minWidth: "150",
  },
  {
    label: "力量配置",
    prop: "ll_pz",
    minWidth: "300",
  },
  {
    label: "人数（人）",
    prop: "rs",
    minWidth: "150",
  },
  {
    label: "装备器材物资给养",
    prop: "zbqc_wz",
    minWidth: "300",
  },
  {
    label: "编组",
    prop: "bz",
    minWidth: "300",
  },
];

const llbcList = ref([
  {
    data0: "X",
    data1: "X",
    data2: "X",
    data3: "X",
    data4: "X",
    data5: "X",
  },
]);

// 跨区支援行动协同计划表
const getXdData = () => {
  return postTableData({
    docType: "crosssupport",
    method: "kuaquzhiyuanxietongjihua",
  }).then((res) => {
    if (res.code === 200) {
      kqzyList.value = res?.data || [];
    }
  });
};
// 跨区支援力量编成表
const getLlData = () => {
  return postTableData({
    docType: "crosssupport",
    method: "kuaquzhiyuanliliangbiancheng",
  }).then((res) => {
    if (res.code === 200) {
      llbcList.value = res?.data || [];
    }
  });
};

onMounted(async () => {
  await getLlData();
  await getXdData();
});
</script>
<template>
  <div class="">
    <FirstTitle :name="city + '跨区支援行动协同计划表'" />
    <PsbzTable :headers="kqzyHeaders" :tableData="kqzyList" />
    <FirstTitle :name="city + '跨区支援力量编成表'" class="top-15" />
    <PsbzTable :headers="llbcHeaders" :tableData="llbcList" />
  </div>
</template>
<style scoped lang="scss"></style>